﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Ordinaire;

namespace Ordinaire.Commerce
{
    /// <summary>
    /// Servers as inter-module/library API that allows external class to observe desired action.
    /// </summary>
    /// <remarks>Inherits this class to get notified of any actions run by Purchasing managers.</remarks>
    public abstract class PurchasingObserver
    {
        /// <summary>
        /// Raises prior to NewPurchase call.
        /// </summary>
        /// <param name="source">the manager</param>
        /// <param name="args">the call parameters</param>
        public virtual void OnPreNewPurchase(object source, Dictionary<string, object> args) { }

        /// <summary>
        /// Raises prior to NewPurchase call.
        /// </summary>
        /// <param name="source">the manager</param>
        /// <param name="args">the call parameters</param>
        public virtual void OnNewPurchase(object source, Dictionary<string, object> args) { }

        /// <summary>
        /// Raises prior to AddPurchaseItem call.
        /// </summary>
        /// <param name="source">the manager</param>
        /// <param name="args">the call parameters</param>
        public virtual void OnPreAddPurchaseItem(object source, Dictionary<string, object> args) { }

        /// <summary>
        /// Raises upon AddPurchaseItem call.
        /// </summary>
        /// <param name="source">the manager</param>
        /// <param name="args">the call parameters</param>
        public virtual void OnAddPurchaseItem(object source, Dictionary<string, object> args) { }

        /// <summary>
        /// Raises prior to DeletePurchaseItem call.
        /// </summary>
        /// <param name="source">the manager</param>
        /// <param name="args">the call parameters</param>
        public virtual void OnPreDeletePurchaseItem(object source, Dictionary<string, object> args) { }

        /// <summary>
        /// Raises upon DeletePurchaseItem call.
        /// </summary>
        /// <param name="source">the manager</param>
        /// <param name="args">the call parameters</param>
        public virtual void OnDeletePurchaseItem(object source, Dictionary<string, object> args) { }

        /// <summary>
        /// Raises prior to AddPayment call.
        /// </summary>
        /// <param name="source">the manager</param>
        /// <param name="args">the call parameters</param>
        public virtual void OnPreAddPayment(object source, Dictionary<string, object> args) { }

        /// <summary>
        /// Raises upon AddPayment call.
        /// </summary>
        /// <param name="source">the manager</param>
        /// <param name="args">the call parameters</param>
        public virtual void OnAddPayment(object source, Dictionary<string, object> args) { }
    }
}
